From: Wei Liu Date: Thu, 26 May 2011 14:01:17 +0000 (+0100) Subject: libxc: add new operation in HVMOP to deliver emulated MSI. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10281^2~1 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=79df5f2ba8d3f892cadd0dc10b26864601ab0019;p=xen.git libxc: add new operation in HVMOP to deliver emulated MSI. Signed-off-by: Wei Liu --- diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index b87bbc0cf9..a99aebb8ad 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -417,6 +417,35 @@ int xc_hvm_set_pci_link_route( return rc; } +int xc_hvm_inject_msi( + xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data) +{ + DECLARE_HYPERCALL; + DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inj_msi, arg); + int rc; + + arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg)); + if ( arg == NULL ) + { + PERROR("Could not allocate memory for xc_hvm_inj_msi hypercall"); + return -1; + } + + hypercall.op = __HYPERVISOR_hvm_op; + hypercall.arg[0] = HVMOP_inj_msi; + hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg); + + arg->domid = dom; + arg->addr = addr; + arg->data = data; + + rc = do_xen_hypercall(xch, &hypercall); + + xc_hypercall_buffer_free(xch, arg); + + return rc; +} + int xc_hvm_track_dirty_vram( xc_interface *xch, domid_t dom, uint64_t first_pfn, uint64_t nr, diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index 0c4c6fb399..49447e63d9 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -1398,6 +1398,8 @@ int xc_hvm_set_isa_irq_level( int xc_hvm_set_pci_link_route( xc_interface *xch, domid_t dom, uint8_t link, uint8_t isa_irq); +int xc_hvm_inject_msi( + xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data); /* * Track dirty bit changes in the VRAM area